home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Online / hsc / source / test / macro.hsc < prev    next >
Encoding:
Text File  |  1997-03-04  |  1.5 KB  |  80 lines

  1. <* simple macro without attributes *>
  2. <$macro simple_resi SEPP:string="sepp_simple">
  3. simple_resi.
  4. sepp(simple)=<(sepp)>
  5. <$let sepp="sepp_simple_2">
  6. sepp(simple)=<(sepp)> (after <$source><$let></$source>)
  7. </$macro>
  8.  
  9.  
  10. <* macro that will be called recursively *>
  11. <$macro recursive_resi SEPP:string="sepp_recursive">
  12.   recursive_start: sepp=<(sepp)>
  13.   <$if cond=(sepp="sepp_recursive_x_x_x")>
  14.     ABORT recursion.
  15.   <$else>
  16.     <recursive_resi sepp=(sepp+"_x")>
  17.   </$if>
  18.   recursive_end  : sepp=<(sepp)>
  19. </$macro>
  20.  
  21.  
  22. <* old-style container *>
  23. <$macro resi SEPP:string="sepp_resi">
  24.     resi_start: sepp=<(sepp)>
  25. </$macro>
  26. <$macro /resi>
  27.     resi_end  : sepp=<(sepp)>
  28. </$macro>
  29.  
  30.  
  31. <* new style container *>
  32. <$macro paired_resi /CLOSE SEPP:string="sepp_paired">
  33. (start paired resi)
  34.   sepp(paired)=<(sepp)> 
  35.   <$content>
  36.   sepp(paired)=<(sepp)> 
  37. (end paired resi)
  38. </$macro>
  39.  
  40.  
  41. <***************************************>
  42. <HTML><HEAD><TITLE>kack</TITLE></HEAD><BODY>
  43.  
  44. ----simple resi----
  45. <simple_resi>
  46.  
  47. ----old-style container----
  48. <resi> (inside resi) </resi>
  49.  
  50. <* comm <* comm2 *> *>
  51. <**** sepp ****>
  52. <***  sepp  ***>
  53.  
  54. <$define sepp:string="sepp_global">
  55.  
  56.  
  57. ----paired resi----
  58. <paired_resi>
  59. <resi>
  60.   sepp(paired)=<(sepp)>
  61. </resi>
  62. </paired_resi>--
  63.  
  64. ----recursive resi----
  65. <recursive_resi>
  66.  
  67. sepp(global)=<(sepp)>
  68.  
  69. ----nesting a container----
  70. <$macro pag /close>(pag<lnk><$content></lnk>pag)</$macro>
  71. <$macro lnk /close>(lnk<hrf><$content></hrf>lnk)</$macro>
  72. <$macro hrf /close>(hrf<$content>hrf)</$macro>
  73.  
  74. twice: <pag>#</pag>
  75. once : <lnk>*</lnk>
  76.  
  77.  
  78.  
  79. </BODY></HTML>
  80.